home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1997-01-28 | 3.9 KB | 146 lines |
- 10 'HELRESON - Helical Resonators - 27 DEC 94 rev. 27 SEP 96
- 20 CLS:KEY OFF
- 30 IF EX$=""THEN EX$="EXIT"
- 40 COLOR 7,0,1
- 50 U1$="###,###.###"
- 60 U2$=" ###.###"
- 70 U3$=" ###.#"
- 80 UL$=STRING$(80,205)
- 90 '
- 100 '.....start
- 110 CLS
- 120 COLOR 15,2
- 130 PRINT " HELICAL RESONATORS (Shielded)";TAB(57);"by George Murphy VE3ERP ";
- 140 COLOR 1,0:PRINT STRING$(80,223);
- 150 COLOR 7,0
- 160 GOSUB 1230
- 170 PRINT UL$;
- 180 PRINT " Press number in < > to choose standard units of measure:"
- 190 PRINT UL$;
- 200 PRINT " < 1 > Metric"
- 210 PRINT " < 2 > U.S.A./Imperial"
- 220 PRINT UL$;
- 230 PRINT " or Press < 0 > to EXIT....."
- 240 Z$=INKEY$
- 250 IF Z$="0"THEN CLS:RUN EX$
- 260 IF Z$="1"THEN UM=25.4:UM$="mm.":GOTO 290
- 270 IF Z$="2"THEN UM=1:UM$="in.":GOTO 290
- 280 GOTO 240
- 290 VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
- 300 GOTO 370
- 310 '
- 320 '.....display input
- 330 LOCATE CSRLIN-1:PRINT " ";
- 340 LOCATE CSRLIN,50:PRINT USING U1$;Z*UM
- 350 RETURN
- 360 '
- 370 '.....start
- 380 VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
- 390 '
- 400 '.....input frequency
- 410 INPUT " ENTER: Resonant frequency (MHz)................. ";F
- 420 Z=F:GOSUB 320
- 430 '
- 440 '.....input shield I.D.
- 450 PRINT " ENTER: Shield Inside Diameter (";UM$;").............";:INPUT SD
- 460 SD=SD/UM:Z=SD:GOSUB 320
- 470 '
- 480 '.....input coil wire thickness
- 490 PRINT " ENTER: Coil conductor thickness (";UM$;")...........";:INPUT WT
- 500 WT=WT/UM:Z=WT:GOSUB 320
- 510 '
- 520 '.....input coil diameter
- 530 COLOR 0,7:LOCATE CSRLIN+1
- 540 PRINT " Coil FORM diameter should be within the range of";
- 550 PRINT USING U2$;(SD*0.45-WT)*UM;
- 560 PRINT " ";UM$;" to";USING U2$;(SD*0.6-WT)*UM;:PRINT " ";UM$;" "
- 570 COLOR 7,0:LOCATE CSRLIN-2
- 580 PRINT " ENTER: Coil FORM diameter (";UM$;").................";:INPUT CF
- 590 CF=CF/UM:
- 600 LN=CSRLIN:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE LN
- 610 Z=CF:GOSUB 320
- 620 CD=CF+WT
- 630 PRINT " Coil diameter (";UM$;")...................... ";
- 640 PRINT USING U2$;CD*UM
- 650 '
- 660 '.....input coil length
- 670 COLOR 0,7:LOCATE CSRLIN+1
- 680 PRINT " Turn spacing should be within the range of";
- 690 PRINT USING U2$;WT/0.7*UM;:PRINT " ";UM$;" to";USING U2$;WT/0.5*UM;
- 700 PRINT " ";UM$;" "
- 710 COLOR 7,0:LOCATE CSRLIN-2
- 720 PRINT " ENTER: Turn spacing (";UM$;").......................";:INPUT SP
- 730 LN=CSRLIN:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE LN
- 740 SP=SP/UM:Z=SP:GOSUB 320
- 750 '
- 760 '.....number of turns & turns-per-inch
- 770 TP=1/SP
- 780 PRINT " Turns per 25 mm (inch)................... ";USING U2$;TP
- 790 NT=1900/(F*SD)
- 800 PRINT " Number of turns.......................... ";USING U2$;NT
- 810 '
- 820 '.....coil length
- 830 CL=SP*NT
- 840 PRINT " Coil length (";UM$;")........................ ";
- 850 PRINT USING U2$;CL*UM
- 860 '
- 870 '.....coil ratios
- 880 R1=CL/CD:IF R1>1 AND R1<4 THEN 900
- 890 COLOR 0,7
- 900 PRINT " Coil length-to-diameter ratio............ ";USING U2$;R1;
- 910 PRINT ":1 "
- 920 IF R1>1 AND R1<4 THEN 1010
- 930 IF R1<=1 THEN R$="larger"
- 940 IF R1>=4 THEN R$="smaller"
- 950 PRINT " Ratio should be between 1:1 and 4:1";
- 960 PRINT " - Try again with a ";R$;" conductor. "
- 970 LOCATE CSRLIN,24:PRINT " Press any key to start over....."
- 980 IF INKEY$=""THEN 980
- 990 COLOR 7,0:GOTO 370
- 1000 '
- 1010 COLOR 7,0
- 1020 R2=CD/SD
- 1030 PRINT " Coil diameter-to-shield diameter ratio... ";USING U2$;R2;
- 1040 PRINT ":1"
- 1050 '
- 1060 '.....shield length
- 1070 SL=CL+SD/2
- 1080 PRINT " Approximate shield length (";UM$;").......... ";
- 1090 PRINT USING U3$;SL*UM
- 1100 '
- 1110 '.....characteristic impedance
- 1120 CZ=98*10^3/(F*SD)
- 1130 PRINT " Characteristic impedance (ohms)..........";USING U1$;CZ
- 1140 '
- 1150 '.....unloaded Q
- 1160 QU=50*SD*SQR(F)
- 1170 PRINT " Unloaded Q...............................";USING U1$;QU
- 1180 PRINT UL$;
- 1190 GOSUB 1330
- 1200 GOTO 100 'start
- 1210 END
- 1220 '
- 1230 '.....preface
- 1240 TB=8
- 1250 PRINT TAB(TB);
- 1260 PRINT "This program does calculations associated with the description of"
- 1270 PRINT TAB(TB);
- 1280 PRINT "Helical Resonators in the ARRL ELECTRONICS DATA BOOK, 2nd Edition,"
- 1290 PRINT TAB(TB);
- 1300 PRINT "Networks and Filters section, pages 5-10 and 5-11."
- 1310 RETURN
- 1320 '
- 1330 'HARDCOPY
- 1340 GOSUB 1450:LOCATE 25,2:COLOR 14,6
- 1350 PRINT " Press 1 to print screen, 2 to print screen & ";
- 1360 PRINT "advance paper, or 3 to continue.";:COLOR 7,0
- 1370 Z$=INKEY$:IF Z$="3"THEN GOSUB 1450:RETURN
- 1380 IF Z$="1"OR Z$="2"THEN GOSUB 1450:GOTO 1400
- 1390 GOTO 1370
- 1400 FOR QX=1 TO 24:FOR QY=1 TO 80
- 1410 LPRINT CHR$(SCREEN(QX,QY));
- 1420 NEXT QY:NEXT QX
- 1430 IF Z$="2"THEN LPRINT CHR$(12)
- 1440 GOTO 1340
- 1450 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
-